package org.zoomdev.zoom.dao.utils;

import org.zoomdev.zoom.common.caster.Caster;

import java.util.List;

public final class LogUtils {
    public static String getSql(String sql, List<Object> values) {
        return String.format(sql
                        .replace("%", "%%")
                        .replace("?", "'%s'"),
                values.stream().map(v -> Caster.to(v, String.class))
                        .toArray(Object[]::new));
    }
}
